Get confusion while using Array. Map method in JavaScript